<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<div class="span12 box-content">
	<form class="form-inline well" id="teachCourseFilter_form">
		<div class="controls controls-row">
			<label>学院:</label>
			<select class="span2" style="display:inline;" name="college" ${user.superAdmin?"":"disabled" }>
			  <c:forEach items="${colleges }" var="c">
			 	 <option value="${c.id }" ${c.id==clgId?"selected='selected'":""}>${c.name }</option>
			  </c:forEach>
			</select>
			<button type="button" id="teachCourseFilter_go">筛选</button>
		</div>
	</form>
	<div class="span12">共有${tcCount}条数据,${totalPage }页</div>
	<table class="table table-striped table-bordered" >
		<thead>
		 <tr role="row">
		 	<th >课程名称</th>
		 	<th>授课教师</th>
		 	<th>上课地点</th>
		 	<th>更多</th>
		 </tr>
		</thead>   
		<tbody>
		<c:forEach items="${teachCourseList }" var="tc">
			<tr>
				<td>${tc.course.name }</td>
				<td>${tc.teacher.name }</td>
				<td>${tc.address }</td>
				<td>
					<button class="btn btn-danger tc_delete"data-tcId="${tc.lsh}"  data-target="#tc_delete_box" data-toggle="modal" >删除</button>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination  pagination-centered"
			data-totalPage="${totalPage }" 
			data-currentPage="${page }" 
			data-url="<%=basePath%>admin/teach/showTeachCourseList/${clgId}/{page}"
			style="display:none">
	</div>
	<div class="well">
		<button type="button" class="btn btn-primary" id="tc_add" data-target="#tc_add_box" data-toggle="modal" >
			<i class=" icon-plus icon-white"></i>  
			新建一个授课信息
		</button>
	</div>
</div>
<!-- 删除确认 开始-->
<div class="modal hide fade" id="tc_delete_box">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal">×</button>
		<h3>删除授课信息</h3>
	</div>
	<div class="modal-body">
		<input type="hidden" name="id"/>
            确认删除?删除动作不可撤销!
	</div>
	<div class="modal-footer">
		<a href="#" class="btn" data-dismiss="modal">取消</a>
		<a href="#" class="btn btn-danger" id="tc_delete_box_delete">删除</a>
	</div>
</div>
<!-- 删除确认 结束 -->
<!--  授课信息添加 开始 -->
<div class="modal hide fade" id="tc_add_box">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal">×</button>
		<h3>添加一个课程</h3>
	</div>
	<div class="modal-body">
		<form class="form-horizontal">
			<input name="clgId" type="hidden" value="${clgId }" >
			<div class="control-group">
				<label class="control-label">课程:</label>
				<div class="controls">
					<select  name="course" >
						<c:forEach items="${courseList }" var="c">
							<option value="${c.id }">${c.name }</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">教师所在学院:</label>
				<div class="controls">
					<select  name="college" ${user.superAdmin?"":"disabled" }>
						<c:forEach items="${colleges }" var="c">
							<option value="${c.id }" ${c.id==clgId?"selected='selected'":""}>${c.name }</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">教师所在系:</label>
				<div class="controls">
					<select name="department"></select>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">教师:</label>
				<div class="controls">
					<select name="teacher"></select>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">上课地点:</label>
				<div class="controls">
					<input name="address" type="text" >
				</div>
			</div>
		</form>
	</div>
	<div class="modal-footer">
		<a href="#" class="btn" data-dismiss="modal">取消</a>
		<a href="#" class="btn btn-primary" id="tc_add_box_save">保存</a>
	</div>
</div>
<!-- 授课信息添加 结束 -->